package com.org.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.org.pojo.NormalUser;
import com.org.common.PageBean;

import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;

/**
 * ClassName: NormalUserService
 * Package: com.org.service
 * Description:
 *
 * @Author Origin
 * @Create 2024/2/2 0:47
 * @Version 1.0
 */
public interface NormalUserService extends IService<NormalUser> {

    //根据username搜索用户
    NormalUser findByUsername(String username);

    //注册
    void register(NormalUser normalUser) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException;

    //更新用户数据
    void update(NormalUser normalUser);

    //更新头像
    void updateAvatar(String avatarUrl);

    //更新密码
    void updatePwd(String newPwd);

    //更新实名信息
    void updateIdentity(String name, String sex, String phone, String identityId, String identityIdImg);

    //更新用户状态
    void updateState(Integer id, String state, String level) throws Exception;


    //列表查询所有用户
    PageBean<NormalUser> list(Integer pageNum, Integer pageSize, String username, String communityId, String name, String identityId, String phone, String isOldman, String isVolunteer, String sex, String state, String chainKey);

    //删除用户
    void delete(Integer id);

    //根据id获取信息
    NormalUser getInfoById(Integer id);
}
